// src/router/index.js
import Vue from "vue";
import VueRouter from "vue-router";
import { Notification, MessageBox, Message } from "element-ui";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "Home",
    component: (resolve) => require(["@/views/index"], resolve),
  },
  {
    path: "/login",
    name: "login",
    component: (resolve) => require(["@/views/login/index"], resolve),
  },
  {
    path: "/paipan",
    name: "paipan",
    meta: {
      requiresAuth: true,
    },
    component: (resolve) => require(["@/views/paipan/index"], resolve),
  },
  {
    path: "/wendao",
    name: "wendao",
    meta: {
      requiresAuth: true,
    },
    component: (resolve) => require(["@/views/wendao/index"], resolve),
  },
  {
    path: "/lesson",
    name: "lesson",
    meta: {
      requiresAuth: true,
    },
    component: (resolve) => require(["@/views/lesson/index"], resolve),
  },
  {
    path: "/goodsCart",
    name: "goodsCart",
    meta: {
      requiresAuth: true,
    },
    component: (resolve) => require(["@/views/lesson/goodsCart"], resolve),
  },
  {
    path: "/myLesson",
    name: "myLesson",
    meta: {
      requiresAuth: true,
    },
    component: (resolve) => require(["@/views/lesson/myLesson"], resolve),
  },

  {
    path: "/bazicesuan",
    name: "bazicesuan",
    meta: {
      requiresAuth: true,
    },
    component: (resolve) => require(["@/views/other/bazicesuan"], resolve),
  },
  {
    path: "/wenzhang",
    name: "wenzhang",
    meta: {
      requiresAuth: true,
    },
    component: (resolve) => require(["@/views/other/wenzhang"], resolve),
  },
  {
    path: "/other",
    name: "other",
    meta: {
      requiresAuth: true,
    },
    component: (resolve) => require(["@/views/other/index"], resolve),
  },
  {
    path: "/shopOrderList",
    name: "shopOrderList",
    meta: {
      requiresAuth: true,
    },
    component: (resolve) => require(["@/views/shop/orderList/index"], resolve),
  },
  {
    path: "/shopOrderDetails",
    name: "shopOrderDetails",
    meta: {
      requiresAuth: true,
    },
    component: (resolve) =>
      require(["@/views/shop/orderList/details"], resolve),
  },
  {
    path: "/payOrder",
    name: "payOrder",
    meta: {
      requiresAuth: true,
    },
    component: (resolve) => require(["@/views/lesson/payOrder"], resolve),
  },
  {
    path: "/payMoney",
    name: "payMoney",
    meta: {
      requiresAuth: true,
    },
    component: (resolve) => require(["@/views/lesson/payMoney"], resolve),
  },
  {
    path: "/orderList",
    name: "orderList",
    meta: {
      requiresAuth: true,
    },
    component: (resolve) => require(["@/views/lesson/orderList"], resolve),
  },
  {
    path: "/video",
    name: "video",
    meta: {
      requiresAuth: true,
    },
    component: (resolve) => require(["@/views/lesson/videoPlay"], resolve),
  },

  {
    path: "/lessonList",
    name: "lessonList",
    meta: {
      requiresAuth: true,
    },
    component: (resolve) => require(["@/views/lesson/list"], resolve),
  },

  {
    path: "/shop",
    name: "shop",
    meta: {
      requiresAuth: true,
    },
    component: (resolve) => require(["@/views/shop/index"], resolve),
  },
  {
    path: "/shopDetails",
    name: "shopDetails",
    meta: {
      requiresAuth: true,
    },
    component: (resolve) => require(["@/views/shop/shopDetails"], resolve),
  },
  {
    path: "/shopCart",
    name: "shopCart",
    meta: {
      requiresAuth: true,
    },
    component: (resolve) => require(["@/views/shop/shopCart"], resolve),
  },
  {
    path: "/shopPay",
    name: "shopPay",
    meta: {
      requiresAuth: true,
    },
    component: (resolve) => require(["@/views/shop/shopPay"], resolve),
  },

  {
    path: "/address",
    name: "address",
    meta: {
      requiresAuth: true,
    },
    component: (resolve) => require(["@/views/address/index"], resolve),
  },

  {
    path: "/addressEdit",
    name: "addressEdit",
    meta: {
      requiresAuth: true,
    },
    component: (resolve) => require(["@/views/address/edit"], resolve),
  },
  {
    path: "/payShopMoney",
    name: "payShopMoney",
    meta: {
      requiresAuth: true,
    },
    component: (resolve) => require(["@/views/shop/payShopMoney"], resolve),
  },
  {
    path: "/lessonSuccess",
    name: "lessonSuccess",
    meta: {
      requiresAuth: true,
    },
    component: (resolve) => require(["@/views/lesson/lessonSuccess"], resolve),
  },
  {
    path: "/shopSuccess",
    name: "shopSuccess",
    meta: {
      requiresAuth: true,
    },
    component: (resolve) => require(["@/views/shop/shopSuccess"], resolve),
  },
  {
    path: "/payShopMoney",
    name: "payShopMoney",
    meta: {
      requiresAuth: true,
    },
    component: (resolve) => require(["@/views/shop/payShopMoney"], resolve),
  },
];
// 导航守卫

const router = new VueRouter({
  mode: "history", // 使用 HTML5 History 模式
  //   base: process.env.BASE_URL,
  routes,
});

export default router;
